﻿@model HelloMinasan.Web.Song.ViewModels.SongBankTestViewModel

@{
    ViewBag.Title = "CreateBankTest";
}

<link href="@Url.Content("~/Scripts/cleditor/jquery.cleditor.css")" rel="stylesheet" type="text/css" /> 
<script src="@Url.Content("~/Scripts/cleditor/jquery.cleditor.min.js")" type="text/javascript"></script> 
<script src="@Url.Content("~/Scripts/cleditor/jquery.cleditor.xhtml.min.js")" type="text/javascript"></script> 

@{
    ViewBag.Title = "Create";
}

<script type="text/javascript">
 
    $(document).ready(function () {
        var options = {
            width: 955,
            height: 400
    };
 
    var editor = $("#editor").cleditor(options)[0];
 
    $("#btnClear").click(function (e) {
        e.preventDefault();
        editor.focus();
        editor.clear();
    });
 
    $("#btnAddImage").click(function () {
        editor.execCommand("insertimage",
            "http://images.free-extras.com/pics/s/smile-1620.JPG", null, null);
        editor.focus();
    });
    //cái này nó show được html rồi, giờ muốn lấy để đưa qua Controllers để save xuống db
    //$("#btnGetHtml").click(function () {
    //    alert($("#editor").val());
    //});
    });
</script>
 

<body>
   @using (Html.BeginForm("CreateBankTest", "SongBankTest", FormMethod.Post))
    {
        <div style="width: 400px">
            <div>
                @Html.TextAreaFor(m => m.LyricContent, new {id="editor", name="editor", rows="0", cols="0" })
            </div>
            <div style="min-height: 30px; clear:both;" >
                <input class="siteButton" id="btnGetHtml" name="btnGetHtml" type="submit" value="Save" onclick="location.href = '/LeaveApplication?isReload=1'" />
            </div> 
        </div>
    }
</body>

<input class="siteButton" id="btTest" name="btTest" type="submit" value="Test" onclick="location.href = 'SongBankTest/TestBank/1'" />